<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <!-- Meta, title, CSS, favicons, etc. -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>修改APP基础信息</title>

    <!-- Bootstrap -->
    <link href="${pageContext.request.contextPath}/statics/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome -->
    <link href="${pageContext.request.contextPath}/statics/css/documentation/fonts/css/font-awesome.min.css" rel="stylesheet">
    <!-- NProgress -->
    <link href="${pageContext.request.contextPath}/statics/css/vendors/nprogress/nprogress.css" rel="stylesheet">
    <!-- iCheck -->
    <link href="${pageContext.request.contextPath}/statics/css/vendors/iCheck/skins/flat/green.css" rel="stylesheet">
    <!-- bootstrap-progressbar -->
    <link href="${pageContext.request.contextPath}/statics/css/vendors/bootstrap-progressbar/css/bootstrap-progressbar-3.3.4.min.css" rel="stylesheet">
    <!-- JQVMap -->
    <link href="${pageContext.request.contextPath}/statics/css/vendors/jqvmap/dist/jqvmap.min.css" rel="stylesheet"/>

    <!-- Custom Theme Style -->
    <link href="${pageContext.request.contextPath}/statics/css/build/css/custom.min.css" rel="stylesheet">
  </head>

  <body class="nav-md">
    <div class="container body">
      <div class="main_container">
   <%--     <%@include file="devLeftNav.jsp"%>
        <%@include file="devTopNav.jsp"%>--%>
        <!-- page content -->
        <div class="right_col" role="main">
          <div class="">
            <div class="page-title">
              <div class="title_left">
                <h3>修改APP基础信息</h3>
              </div>
            </div>
            <div class="clearfix"></div>

            <div class="row">
              <div class="col-md-12 col-sm-12 col-xs-12">
                <div class="x_panel">
                  <div class="x_content" style="margin-top: 25px;">
                    <form class="form-horizontal form-label-left" novalidate="" action="${pageContext.request.contextPath}/info/updateAppInfoList" enctype="multipart/form-data" method="post">
                        <input type="hidden" id="${info.id}" name="id" value="${info.id}"/>
                        <div class="item form-group">
                            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="softwareNamee">手游名称${info.id} <span class="required">*</span>
                            </label>
                            <div class="col-md-6 col-sm-6 col-xs-12">
                                <input type="text" id="softwareNamee" name="softwareName" value="${info.softwareName}" placeholder="请输入手游名称" required="required" class="form-control col-md-7 col-xs-12">
                            </div>
                        </div>
                      <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="APKName">APK名称 <span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <input type="text" id="APKName" name="APKName" value="${info.APKName}" placeholder="请输入APK名称" required="required" class="form-control col-md-7 col-xs-12">
                        </div>
                      </div>
                      <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="supportROM">支持ROM<span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <input type="text" id="supportROM" name="supportROM" value="${info.supportROM}" placeholder="请输入支持的ROM" required="required" class="form-control col-md-7 col-xs-12">
                        </div>
                      </div>
                      <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="interfaceLanguage">界面语言 <span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <input type="text" id="interfaceLanguage" name="interfaceLanguage"  value="${info.interfaceLanguage}" placeholder="请输入手游支持的界面语言" required="required" class="form-control col-md-7 col-xs-12">
                        </div>
                      </div>
                      <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="softwareSize">手游大小 <span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <input type="text" id="softwareSize" name="softwareSize" value="${info.softwareSize}" placeholder="请输入手游大小，单位为MB" required="required" class="form-control col-md-7 col-xs-12">
                        </div>
                      </div>
                      <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="downloads">下载次数 <span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <input type="text" id="downloads" name="downloads" value="${info.downloads}" placeholder="请输入下载次数" required="required" class="optional form-control col-md-7 col-xs-12">
                        </div>
                      </div>
                      <div class="item form-group">
                        <label class="control-label col-md-3">所属平台</label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <select style="width: 581.6px" class="form-control" id="flatformId" name="flatformId">
                                <option value="0">请选择</option>
                                <c:if test="${list4==null}">
                                    <jsp:forward page="/dictionary/getflatformNametoUpadte"></jsp:forward>
                                </c:if>
                                <c:forEach items="${list4}" var="list4">
                                    <c:if test="${list4.valueId==info.flatformId}">
                                        <option value="${list4.valueId}" selected>${list4.valueName}</option>
                                    </c:if>
                                        <option value="${list4.valueId}">${list4.valueName}</option>
                                </c:forEach>
                            </select>
                        </div>
                      </div>
                      <div class="item form-group">
                        <label class="control-label col-md-3">一级分类</label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <select style="width: 581.6px" class="form-control" id="yiji" name="categoryLevel1">
                            <option value="0">- 请选择 -</option>
                          </select>
                        </div>
                      </div>
                      <div class="item form-group">
                        <label  class="control-label col-md-3">二级分类</label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <select style="width: 581.6px" class="form-control" id="erji" name="categoryLevel2">

                          </select>
                        </div>
                      </div>
                      <div class="item form-group">
                        <label class="control-label col-md-3">三级分类</label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <select style="width: 581.6px" class="form-control" id="sanji" name="categoryLevel3">

                          </select>
                        </div>
                      </div>
                      <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="status">手游状态 <span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                         <%-- <p style="font-size: 16px;" id="status">待审核</p>--%>
                            <c:if test="${info.status==1}">
                                <input type="text" id="status" name="statuss" value="待审核" placeholder="请输入支持的ROM" required="required" class="form-control col-md-7 col-xs-12" readonly="readonly">
                            </c:if>
                             <c:if test="${info.status==3}">
                                 <input type="text" id="status" name="statuss" value="审核未通过" placeholder="请输入支持的ROM" required="required" class="form-control col-md-7 col-xs-12" readonly="readonly">
                             </c:if>
                        </div>
                      </div>
                      <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="appInfo">应用简介 <span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <textarea id="appInfo" name="appInfo" placeholder="请输入本手游的相关信息，本信息作为手游的详细信息进行介绍" required="required" class="form-control col-md-7 col-xs-12">${info.appInfo}</textarea>
                        </div>
                      </div>
                      <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" >LOGO图片 <span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12" id="pathdiv">
                 <%--         <input type="file" id="logoPicPath" name="logoPicPath" class="form-control col-md-7 col-xs-12">--%>
                            <img src="${pageContext.request.contextPath}/${info.logoPicPath}" width="100px">
                            <input type="hidden" name="logoPicPath" value="${info.logoPicPath}">
                            <a href="javascript:;" id="shanchu">删除</a>
                        </div>
                      </div>
                      <div class="ln_solid"></div>
                      <div class="form-group">
                        <div class="col-md-6 col-md-offset-3">
                            <c:if test="${info.status==3}">
                                <button id="${info.id}" type="button" class="btn btn-success" name="jiao">保存并再次提交审核</button>
                            </c:if>
                          <button id="send" type="submit" class="btn btn-success">保存</button>
                          <a href="${pageContext.request.contextPath}/info/getuserKaiauditList"><button type="button" class="btn btn-primary">返回</button></a>
                        </div>
                      </div>
                    </form>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>

    <!-- jQuery -->
    <script src="${pageContext.request.contextPath}/statics/css/vendors/jquery/dist/jquery.min.js"></script>
    <!-- Bootstrap -->
    <script src="${pageContext.request.contextPath}/statics/css/vendors/bootstrap/dist/js/bootstrap.min.js"></script>
    <!-- FastClick -->
    <script src="${pageContext.request.contextPath}/statics/css/vendors/fastclick/lib/fastclick.js"></script>
    <!-- NProgress -->
    <script src="${pageContext.request.contextPath}/statics/css/vendors/nprogress/nprogress.js"></script>
    <!-- Chart.js -->
    <script src="${pageContext.request.contextPath}/statics/css/vendors/Chart.js/dist/Chart.min.js"></script>
    <!-- gauge.js -->
    <script src="${pageContext.request.contextPath}/statics/css/vendors/gauge.js/dist/gauge.min.js"></script>
    <!-- bootstrap-progressbar -->
    <script src="${pageContext.request.contextPath}/statics/css/vendors/bootstrap-progressbar/bootstrap-progressbar.min.js"></script>
    <!-- iCheck -->
    <script src="${pageContext.request.contextPath}/statics/css/vendors/iCheck/icheck.min.js"></script>
    <!-- Skycons -->
    <script src="${pageContext.request.contextPath}/statics/css/vendors/skycons/skycons.js"></script>
    <!-- Flot -->
    <script src="${pageContext.request.contextPath}/statics/css/vendors/Flot/jquery.flot.js"></script>
    <script src="${pageContext.request.contextPath}/statics/css/vendors/Flot/jquery.flot.pie.js"></script>
    <script src="${pageContext.request.contextPath}/statics/css/vendors/Flot/jquery.flot.time.js"></script>
    <script src="${pageContext.request.contextPath}/statics/css/vendors/Flot/jquery.flot.stack.js"></script>
    <script src="${pageContext.request.contextPath}/statics/css/vendors/Flot/jquery.flot.resize.js"></script>
    <!-- Flot plugins -->
    <script src="${pageContext.request.contextPath}/statics/css/vendors/flot.orderbars/js/jquery.flot.orderBars.js"></script>
    <script src="${pageContext.request.contextPath}/statics/css/vendors/flot-spline/js/jquery.flot.spline.min.js"></script>
    <script src="${pageContext.request.contextPath}/statics/css/vendors/flot.curvedlines/curvedLines.js"></script>
    <!-- DateJS -->
    <script src="${pageContext.request.contextPath}/statics/css/vendors/DateJS/build/date.js"></script>
    <!-- JQVMap -->
    <script src="${pageContext.request.contextPath}/statics/css/vendors/jqvmap/dist/jquery.vmap.js"></script>
    <script src="${pageContext.request.contextPath}/statics/css/vendors/jqvmap/dist/maps/jquery.vmap.world.js"></script>
    <script src="${pageContext.request.contextPath}/statics/css/vendors/jqvmap/examples/js/jquery.vmap.sampledata.js"></script>
    <!-- bootstrap-daterangepicker -->
    <script src="${pageContext.request.contextPath}/statics/css/production/js/moment/moment.min.js"></script>
    <script src="${pageContext.request.contextPath}/statics/css/production/js/datepicker/daterangepicker.js"></script>

    <!-- Custom Theme Scripts -->
    <script src="${pageContext.request.contextPath}/statics/css/build/js/custom.min.js"></script>
    <script src="${pageContext.request.contextPath}/statics/css/vendors/validator/validator.js"></script>

    <!-- validator -->
    <script>
      // initialize the validator function
      validator.message.date = 'not a real date';

      // validate a field on "blur" event, a 'select' on 'change' event & a '.reuired' classed multifield on 'keyup':
      $('form')
              .on('blur', 'input[required], input.optional, select.required', validator.checkField)
              .on('change', 'select.required', validator.checkField)
              .on('keypress', 'input[required][pattern]', validator.keypress);

      $('.multi.required').on('keyup blur', 'input', function() {
        validator.checkField.apply($(this).siblings().last()[0]);
      });

      $('form').submit(function(e) {
        e.preventDefault();
        var submit = true;

        // evaluate the form using generic validaing
        if (!validator.checkAll($(this))) {
          submit = false;
        }

        if (submit)
          this.submit();

        return false;
      });
    </script>
    <!-- /validator -->
    <!-- Flot -->
    <script>
      $(document).ready(function() {
        var data1 = [
          [gd(2012, 1, 1), 17],
          [gd(2012, 1, 2), 74],
          [gd(2012, 1, 3), 6],
          [gd(2012, 1, 4), 39],
          [gd(2012, 1, 5), 20],
          [gd(2012, 1, 6), 85],
          [gd(2012, 1, 7), 7]
        ];

        var data2 = [
          [gd(2012, 1, 1), 82],
          [gd(2012, 1, 2), 23],
          [gd(2012, 1, 3), 66],
          [gd(2012, 1, 4), 9],
          [gd(2012, 1, 5), 119],
          [gd(2012, 1, 6), 6],
          [gd(2012, 1, 7), 9]
        ];
        $("#canvas_dahs").length && $.plot($("#canvas_dahs"), [
          data1, data2
        ], {
          series: {
            lines: {
              show: false,
              fill: true
            },
            splines: {
              show: true,
              tension: 0.4,
              lineWidth: 1,
              fill: 0.4
            },
            points: {
              radius: 0,
              show: true
            },
            shadowSize: 2
          },
          grid: {
            verticalLines: true,
            hoverable: true,
            clickable: true,
            tickColor: "#d5d5d5",
            borderWidth: 1,
            color: '#fff'
          },
          colors: ["rgba(38, 185, 154, 0.38)", "rgba(3, 88, 106, 0.38)"],
          xaxis: {
            tickColor: "rgba(51, 51, 51, 0.06)",
            mode: "time",
            tickSize: [1, "day"],
            //tickLength: 10,
            axisLabel: "Date",
            axisLabelUseCanvas: true,
            axisLabelFontSizePixels: 12,
            axisLabelFontFamily: 'Verdana, Arial',
            axisLabelPadding: 10
          },
          yaxis: {
            ticks: 8,
            tickColor: "rgba(51, 51, 51, 0.06)",
          },
          tooltip: false
        });

        function gd(year, month, day) {
          return new Date(year, month - 1, day).getTime();
        }
      });
    </script>
    <!-- /Flot -->

    <!-- JQVMap -->
    <script>
      $(document).ready(function(){
        $('#world-map-gdp').vectorMap({
            map: 'world_en',
            backgroundColor: null,
            color: '#ffffff',
            hoverOpacity: 0.7,
            selectedColor: '#666666',
            enableZoom: true,
            showTooltip: true,
            values: sample_data,
            scaleColors: ['#E6F2F0', '#149B7E'],
            normalizeFunction: 'polynomial'
        });
      });
    </script>
    <!-- /JQVMap -->

    <!-- Skycons -->
    <script>
      $(document).ready(function() {
        var icons = new Skycons({
            "color": "#73879C"
          }),
          list = [
            "clear-day", "clear-night", "partly-cloudy-day",
            "partly-cloudy-night", "cloudy", "rain", "sleet", "snow", "wind",
            "fog"
          ],
          i;

        for (i = list.length; i--;)
          icons.set(list[i], list[i]);

        icons.play();
      });
    </script>
    <!-- /Skycons -->

    <!-- Doughnut Chart -->
    <script>
      $(document).ready(function(){
        var options = {
          legend: false,
          responsive: false
        };

        new Chart(document.getElementById("canvas1"), {
          type: 'doughnut',
          tooltipFillColor: "rgba(51, 51, 51, 0.55)",
          data: {
            labels: [
              "Symbian",
              "Blackberry",
              "Other",
              "Android",
              "IOS"
            ],
            datasets: [{
              data: [15, 20, 30, 10, 30],
              backgroundColor: [
                "#BDC3C7",
                "#9B59B6",
                "#E74C3C",
                "#26B99A",
                "#3498DB"
              ],
              hoverBackgroundColor: [
                "#CFD4D8",
                "#B370CF",
                "#E95E4F",
                "#36CAAB",
                "#49A9EA"
              ]
            }]
          },
          options: options
        });
      });
    </script>
    <!-- /Doughnut Chart -->
    
    <!-- bootstrap-daterangepicker -->
    <script>
      $(document).ready(function() {

        var cb = function(start, end, label) {
          console.log(start.toISOString(), end.toISOString(), label);
          $('#reportrange span').html(start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY'));
        };

        var optionSet1 = {
          startDate: moment().subtract(29, 'days'),
          endDate: moment(),
          minDate: '01/01/2012',
          maxDate: '12/31/2015',
          dateLimit: {
            days: 60
          },
          showDropdowns: true,
          showWeekNumbers: true,
          timePicker: false,
          timePickerIncrement: 1,
          timePicker12Hour: true,
          ranges: {
            'Today': [moment(), moment()],
            'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
            'Last 7 Days': [moment().subtract(6, 'days'), moment()],
            'Last 30 Days': [moment().subtract(29, 'days'), moment()],
            'This Month': [moment().startOf('month'), moment().endOf('month')],
            'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
          },
          opens: 'left',
          buttonClasses: ['btn btn-default'],
          applyClass: 'btn-small btn-primary',
          cancelClass: 'btn-small',
          format: 'MM/DD/YYYY',
          separator: ' to ',
          locale: {
            applyLabel: 'Submit',
            cancelLabel: 'Clear',
            fromLabel: 'From',
            toLabel: 'To',
            customRangeLabel: 'Custom',
            daysOfWeek: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
            monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
            firstDay: 1
          }
        };
        $('#reportrange span').html(moment().subtract(29, 'days').format('MMMM D, YYYY') + ' - ' + moment().format('MMMM D, YYYY'));
        $('#reportrange').daterangepicker(optionSet1, cb);
        $('#reportrange').on('show.daterangepicker', function() {
          console.log("show event fired");
        });
        $('#reportrange').on('hide.daterangepicker', function() {
          console.log("hide event fired");
        });
        $('#reportrange').on('apply.daterangepicker', function(ev, picker) {
          console.log("apply event fired, start/end dates are " + picker.startDate.format('MMMM D, YYYY') + " to " + picker.endDate.format('MMMM D, YYYY'));
        });
        $('#reportrange').on('cancel.daterangepicker', function(ev, picker) {
          console.log("cancel event fired");
        });
        $('#options1').click(function() {
          $('#reportrange').data('daterangepicker').setOptions(optionSet1, cb);
        });
        $('#options2').click(function() {
          $('#reportrange').data('daterangepicker').setOptions(optionSet2, cb);
        });
        $('#destroy').click(function() {
          $('#reportrange').data('daterangepicker').remove();
        });
      });
    </script>
    <!-- /bootstrap-daterangepicker -->

    <!-- gauge.js -->
    <script>
      var opts = {
          lines: 12,
          angle: 0,
          lineWidth: 0.4,
          pointer: {
              length: 0.75,
              strokeWidth: 0.042,
              color: '#1D212A'
          },
          limitMax: 'false',
          colorStart: '#1ABC9C',
          colorStop: '#1ABC9C',
          strokeColor: '#F0F3F3',
          generateGradient: true
      };
      var target = document.getElementById('foo'),
          gauge = new Gauge(target).setOptions(opts);

      gauge.maxValue = 6000;
      gauge.animationSpeed = 32;
      gauge.set(3200);
      gauge.setTextField(document.getElementById("gauge-text"));
    </script>
    <!-- /gauge.js -->
       <script src="${pageContext.request.contextPath}/jquery-1.12.4.js"></script>
       <script>
           var path = '${pageContext.request.contextPath}';
           $(function () {
               $("[name=jiao]").click(function(){
                   location.href="${pageContext.request.contextPath}/info/updateStatuszTai?id="+this.id;
               })
               var shan=$("#shanchu");
               shan.click(function(){
                   $("#pathdiv").empty();
                   $("#pathdiv").append("<input type=\"file\" id=\"idPic\" name=\"idPic\" class=\"form-control col-md-7 col-xs-12\">")

               })
               var yi = ${info.categoryLevel1};
               var er = ${info.categoryLevel2};
               var san = ${info.categoryLevel3};
               $.getJSON(path + "/category/getFenji", "parentId=0", function (data) {
                   for (var i = 0; i < data.length; i++) {
                       if (data[i].id==yi){
                           $("#yiji").append("<option value=" + data[i].id + " selected>" + data[i].categoryName + "</option>");
                       }else{
                           $("#yiji").append("<option value=" + data[i].id + " >" + data[i].categoryName + "</option>");
                       }
                   }
               })
               if(er!=null&&er!=""){
                   $.getJSON(path + "/category/getFenji", "parentId=" + yi, function (data) {
                       var obj = $("#erji").empty();
                       $(obj).append("<option value=\"0\">请选择</option>");
                       for (var i = 0; i < data.length; i++) {
                           if (data[i].id==er){
                               $(obj).append("<option value=\"" + data[i].id + "\" selected>" + data[i].categoryName + "</option>");
                           }else{
                               $(obj).append("<option value=\"" + data[i].id + "\" >" + data[i].categoryName + "</option>");
                           }
                       }
                   })
               }
               if(san!=null&&san!=""){
                   $.getJSON(path + "/category/getFenji", "parentId=" + er, function (data) {
                       var obj = $("#sanji").empty();
                       $(obj).append("<option value=\"0\">请选择</option>");
                       for (var i = 0; i < data.length; i++) {
                           if (data[i].id==san){
                               $(obj).append("<option value=\"" + data[i].id + "\" selected>" + data[i].categoryName + "</option>");
                           }else{
                               $(obj).append("<option value=\"" + data[i].id + "\" >" + data[i].categoryName + "</option>");
                           }
                       }
                   })
               }
               $("#yiji").change(function () {
                   $.getJSON(path + "/category/getFenji", "parentId=" + $(this).val(), function (data) {
                       var obj = $("#erji").empty();
                       $("#sanji").empty();
                       $(obj).append("<option value=\"0\">请选择</option>")
                       for (var i = 0; i < data.length; i++) {
                           $(obj).append("<option value=\"" + data[i].id + "\">" + data[i].categoryName + "</option>");
                       }
                   })
               })
               $("#erji").change(function () {
                   $.getJSON(path + "/category/getFenji", "parentId=" + $(this).val(), function (data) {
                       var obj = $("#sanji").empty();
                       $(obj).append("<option value=\"0\">请选择</option>")
                       for (var i = 0; i < data.length; i++) {
                           $(obj).append("<option value=\"" + data[i].id + "\">" + data[i].categoryName + "</option>");
                       }
                   })
               })
           })
       </script>

  </body>
</html>
